﻿//------------------------------------------------------------------------------
// 创建标识: Copyright (C) 2009 Socansoft.com 版权所有
// 创建描述: SocanCode代码生成器自动创建于 2009-5-11 13:14:23
//
// 功能描述: 
//
// 修改标识: 
// 修改描述: 
//------------------------------------------------------------------------------

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;

public partial class Controls_TaoBaoTB_XSJRDListControl : System.Web.UI.UserControl
{
    public event RepeaterCommandEventHandler ItemCommand;
    public List<int> Selected
    {
        get
        {
            List<int> l = new List<int>();
            foreach (RepeaterItem item in rptTB_XSJRD.Items)
            {
                CheckBox cb = item.FindControl("chkChoose") as CheckBox;
                if (cb != null && cb.Checked)
                {
                    HiddenField fld = item.FindControl("hfTB_XSJRD") as HiddenField;
                    if (fld != null)
                    {
                        int id = Convert.ToInt32(fld.Value);
                        l.Add(id);
                    }
                }
            }
            return l;
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
    }

    public void Bind(List<Model.TaoBao.TB_XSJRD> l)
    {
        rptTB_XSJRD.DataSource = l;
        rptTB_XSJRD.DataBind();
    }

    protected void rptTB_XSJRD_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (ItemCommand != null)
            ItemCommand(source, e);
    }
    /// <summary>
    /// 由淘宝店id获取用户账户
    /// </summary>
    protected string GetZHbyTBID(object o)
    {
        if (o is DBNull|| o==null || o.ToString().Length == 0)
            return null;
        Model.TaoBao.TB_SHANGDIAN shop = new BLL.TaoBao.TB_SHANGDIAN().GetModel(Convert.ToInt32(o));
        return shop.TBZH;
    }
    /// <summary>
    /// 由淘宝店id获取订单来源
    /// </summary>
    protected string GetDDLYbyTBID(object o)
    {
        if (o is DBNull || o==null||o.ToString().Length == 0)
            return null;
        Model.TaoBao.TB_SHANGDIAN shop = new BLL.TaoBao.TB_SHANGDIAN().GetModel(Convert.ToInt32(o));
        string code = shop.DDLY;
        Model.ORDERFROM order = new BLL.ORDERFROM().GetModel(code);
        return order.OF_NAME;
    }
}
